package org.kanglg.demo.service;

import org.kanglg.demo.dao.UserDao;
import org.kanglg.demo.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

@Service
@Transactional(readOnly = true)
public class UserBS {
    @Autowired
    private UserDao user;
    @PersistenceContext
    private EntityManager em;

    public User getUser(String id) {
        String jql = "select t from User t";
        return user.findOne(id);
    }
}
